from django.shortcuts import render, render_to_response


def hello(request):
    context = {}
    context['hello'] = 'Hello World!'
    context['name'] = "Alice"
    context['list'] = [{'name': 'Alice', 'age': 18}, {'name': 'Lucy', 'age': 18}]
    return render(request, 'hello.html', context)

def index(request):
    # 调用Model 获取list
    return render(request, 'index.html', {'list':list})

# def login(request):
# 	query = request.GET.get('username','') #request.GET是一个类字典对象，它包含所有GET请求的参数，这里表示取得name为'q'的参数值
# 	if query:
# 		results = 'You just sent %s' % query
# 	else:
# 		results = []
# 	return render_to_response('login.html', {'results': results})